home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
-in_the_mag-
/
workbench
/
adf
/
adflib
/
adflib.lha
/
Lib
/
adf_link.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-05-24
|
1KB
|
69 lines
/*
* ADF Library
*
* adf_link.c
*
*/
#include<string.h>
#include"adf_defs.h"
#include"adf_str.h"
#include"adf_link.h"
#include"adf_dir.h"
extern struct Env adfEnv;
/*
*
*
*/
char* path(struct Volume *vol, SECTNUM parent)
{
struct bEntryBlock entryBlk;
char *tmpPath;
int len;
tmpPath = NULL;
adfReadEntryBlock(vol, parent, &entryBlk);
len = min(entryBlk.nameLen, MAXNAMELEN);
memcpy(tmpPath,entryBlk.name,len);
tmpPath[len]='\0';
/* if (entryBlk.parent!=vol->rootBlock) {
return(strcat(path(vol,entryBlk.parent), tmpPath));
}
else
*/ return(tmpPath);
}
/*
*
*
*/
RETCODE adfBlockPtr2EntryName(struct Volume *vol, SECTNUM nSect, SECTNUM lPar,
char **name, long *size)
{
struct bEntryBlock entryBlk;
struct Entry entry;
if (*name==0) {
adfReadEntryBlock(vol, nSect, &entryBlk);
*size = entryBlk.byteSize;
return RC_OK;
adfEntBlock2Entry(&entryBlk, &entry); //error
/* if (entryBlk.secType!=ST_ROOT && entry.parent!=lPar)
printf("path=%s\n",path(vol,entry.parent));
*/
*name = strdup("");
if (*name==NULL)
return RC_MALLOC;
return RC_OK;
}
else
return RC_OK;
}
/*##################################################################################*/